﻿@page "/search"
@inherits DiariesPageComponentBase

<MyAppBar>
    <MButton Icon="true"
             OnClick="NavigateToBack">
        <MIcon>mdi-arrow-left</MIcon>
    </MButton>

    <TransparentTextField @bind-Value="search"
                          Placeholder="@(I18n.T("Search.Please enter diary keywords"))"
                          OnInput="UpdateDiariesAsync">
    </TransparentTextField>

    <MButton Icon="true"
             OnClick="()=>showFilter=!showFilter">
        <MIcon>
            @(IsDateFiltered ? "mdi-filter-check-outline" : "mdi-filter-outline")
        </MIcon>
    </MButton>
</MyAppBar>

<ScrollContainer>
    <DiaryCardList @bind-Tags="Tags"
                   Value="Diaries"
                   NotFoundText="@(I18n.T("Search.Not Found"))">
    </DiaryCardList>
</ScrollContainer>

<DateFilterDialog @bind-Visible="showFilter"
                  @bind-Value="dateFilter"
                  OnOK="UpdateDiariesAsync"
                  OnReset="UpdateDiariesAsync">
</DateFilterDialog>
